The present invention relates the dynamic generation of expanded user messages in a computer system.
In order to assist developers of computer programs or service personnel to determine the cause of a problem or the reason for unexpected behaviour of a computer system, it is known to generate and store diagnostic information for subsequent analysis. Such diagnostic information typically consists of messages produced in response to events occurring within the computer system.
These events, which are defined as changes occurring within the system, usually trigger messages, which may report on successful events, or, more typically report to the end user that an unsuccessful event, that is, an error, has occurred. The messages contain information as to why the error has occurred and on how the error can be resolved. The messages can assist the developer of the code or a service organisation in problem analysis and may typically include components such as the following:
The messages may be written to log files by applications or other operating system programs. These log files provide a history of the events that have occurred, including when the events occurred and causes of the events. The files can be queried to obtain a visual output of the messages or may automatically display the messages to the end user. A typical log file may be the record of system messages to and responses from a systems operator.
Also known are xe2x80x9ctracexe2x80x9d files, which are usually produced when the sequence of events during execution of a computer program is tracked. The results of the tracing operation are stored in trace files, which may also be displayed for perusal. The term xe2x80x9clog filexe2x80x9d as henceforth referred to, also includes trace files.
However, as can be seen from the above message format, the diagnostic information displayed is often cryptic, unintuitive and may contain inadequate information as to possible cause and suggested solutions. Also, the interpretation or analysis of these messages in log files is potentially complex and prone to error.
U.S. Pat. No. 5,121,475, issued Jun. 9, 1992 to Garry Child et al, describes a method of dynamically generating more user-friendly messages by lookup in a message table of a pre-existing message matching an error log request and the modification of the pre-existing message by data included in the request. The source of the user-friendly message text, however, is not described.
Other approaches to the analysis and presentation of diagnostic information are also known in the art. For example, Abend-Aid XLS from Compuware Corporation provides diagnostic reports alongside source code listings.
Another source of information about the program itself, including a failing portion, is in the form of comments in the program source code. These may contain a great deal more detail than is typically available from error messages. Comments are available to both developers and service organisations as a tool for problem analysis. However, the inspection of comments has to occur manually, since the original source code must be viewed. This is laborious and requires a detailed understanding of the program source code.
Thus, there is a need for user messages to provide sufficient and accurate information to the end user, without requiring the program source code to be examined or displayed. There is also a need for the user messages to be displayed in a user-friendly format, which may be derived automatically.
Accordingly, the present invention provides a method for dynamically generating expanded user messages, in a computer system having a logging tool for creating a log file comprising log messages in response to events occurring during execution of an application program, said method comprising the steps of pre-analysing the application program source code to extract a plurality of types of program component including comments, creating a plurality of relationship tables between said different component types, reading an individual log message from said log file, determining said program components in said log message, reading comments associated with said program components from said relationship tables and combining said comments to produce said expanded user messages.
In other aspects, the present invention provides a system and computer program for generating expanded user messages in accordance with this method.
Specifically, the diagnostic process is improved since the existing comments present in the program source code, header files or message catalogs are used to supplement the original messages from the log files. This provides the end user with more meaningful information and may allow users to perform a greater proportion of problem determination, with a decreased amount of assistance from the service organisation responsible for the application or operating system code itself. The advantages are a reduced workload for service personnel and less time-consuming problem determination, since a detailed analysis of the program source code by the end user is not required.
In a further preferred aspect of the present invention, the program components described comprise functions, variables, conditions and comments. Preferably, pre-analysis of the program source code to create the plurality of relationship tables, includes textual parsing. Preferably, the comments obtained are parsed to form natural language text, which is easier for the end user to understand, hence, more rapid problem determination can occur. To obtain the full benefit of the invention, the comments written in the program source code should be structured in a pre-determined manner. In another preferred aspect of the invention, a mouse driven pointer, positioned over the log messages can select said log messages. Alternatively, the selection of further messages could be automated to increase efficiency.
The relationship tables comprise a function-comment table, a variable-comment table, a condition-comment table and a function-variable table. The relationship tables are stored in binary form and are hashed to enable the expanded user messages to be generated at a greater speed. However, an alternative embodiment could achieve the generation through use of relationship tables stored in a flat text form. The lookup of program components is envisaged to occur using a form of index searching, which is a simple and efficient technique.
In many cases, a log message arises due to an earlier failure or problem within the system. If the log message did not occur immediately after said failure or problem, such that the two log messages were sequential within the log file, the inter-relationship between the two log messages may not be readily apparent. In an extension of the present invention, further log messages in a log file can also be analysed, in order to determine relationships with the individual log message. Further log messages are read from the log file and its program component types are determined. Any inter-relationships between the individual log message and the further log message are determined and this process is recursively repeated until no further log messages can be selected from the log file. The comments associated with all the inter-related program components, derived from the plurality of relationship tables are sorted by order of execution. These comments are combined to produce expanded user messages.
With reference to determining inter-relationships, program components of the individual log message are determined by linking the log message to an identifiable function and set of variables. The program components of the individual log message are then compared recursively to a relationship table to extract all inter-related program components, until no further inter-relationships exist. The iterative process results in a set containing the original program component of the individual log message and the derived program component(s) from the individual log message. The program components are stored in sets by type.
The inter-relationship determination process occurs when a further log message is read. Once its program components have been determined, these are compared to those in the sets derived from the individual log message. An inter-relationship between said individual and said further log messages is established when there is an intersection between program components in the further log message and all the program component sets derived from the individual log message. An indication that an inter-relationship has been derived is displayed to the end user.
The extended invention is advantageous in that it allows multiple relationships to be displayed to the end user, therefore assisting in determining the cause and resolution for a given problem.